/* GUI CONVERTED from rewarp02.p (converter v1.75) Thu Oct  5 12:01:02 2000 */
/* rewarp02.p - REPETITIVE                                                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/*F0PN*/ /*V8:ConvertMode=FullGUIReport                                       */
/* REVISION: 7.3               LAST MODIFIED: 03/03/94   BY: WUG *GN77*       */
/* REVISION: 8.6               LAST MODIFIED: 10/21/97   BY: ays *K13W*       */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane     */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb                  */
/* REVISION: 9.1      LAST MODIFIED: 09/11/00 BY: *N0RQ* BalbeerS Rajput      */

/* WIP ADJUST VALUATION REPORT                                                */


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

         {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rewarp02_p_1 "Effective"
/* MaxLen: Comment: */

&SCOPED-DEFINE rewarp02_p_3 "Cost Set To Use"
/* MaxLen: Comment: */

&SCOPED-DEFINE rewarp02_p_8 "Report Cost Elements"
/* MaxLen: Comment: */

&SCOPED-DEFINE rewarp02_p_9 "Sort Option"
/* MaxLen: Comment: */

/*N0RQ*
 * &SCOPED-DEFINE rewarp02_p_2 "2 - By Extended Cost Descending"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rewarp02_p_4 "3 - G/L Cost"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rewarp02_p_5 "2 - Cum Order Average"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rewarp02_p_6 "1 - Cum Order Standard"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rewarp02_p_7 "1 - By Site, Item, Operation, Line"
 * /* MaxLen: Comment: */
 *N0RQ*/

/* ********** End Translatable Strings Definitions ********* */

/*K13W*/ define new shared variable dept like wc_dept.
/*K13W*/ define new shared variable dept1 like wc_dept label {t001.i}.
/*K13W*/ define new shared variable effdate as date label {&rewarp02_p_1}.
/*K13W*/ define new shared variable effdate1 as date label {t001.i}.
/*K13W*/ define new shared variable emp like op_emp.
/*K13W*/ define new shared variable emp1 like op_emp label {t001.i}.
/*K13W*/ define new shared variable line like wo_line.
/*K13W*/ define new shared variable line1 like wo_line label {t001.i}.
/*K13W*/ define new shared variable lot like wo_lot.
/*K13W*/ define new shared variable lot1 like wo_lot label {t001.i}.
/*K13W*/ define new shared variable mch like wc_mch.
/*K13W*/ define new shared variable mch1 like wc_mch label {t001.i}.
/*K13W*/ define new shared variable part like wo_part.
/*K13W*/ define new shared variable part1 like wo_part label {t001.i}.
/*K13W*/ define new shared variable reason like op_rsn.
/*K13W*/ define new shared variable reason1 like op_rsn label {t001.i}.
/*K13W*/ define new shared variable shift like op_shift.
/*K13W*/ define new shared variable shift1 like op_shift label {t001.i}.
/*K13W*/ define new shared variable site like wo_site.
/*K13W*/ define new shared variable site1 like wo_site label {t001.i}.
/*K13W*/ define new shared variable wkctr like wc_wkctr.
/*K13W*/ define new shared variable wkctr1 like wc_wkctr label {t001.i}.
/*K13W*/ define new shared variable cost_set_to_use as character format "x"
                                                    label {&rewarp02_p_3}.
/*K13W*/ define new shared variable report_cost_elements like mfc_logical
   label {&rewarp02_p_8}.
/*K13W*/ define variable sortoption as integer label {&rewarp02_p_9} format "9"
                                               initial 1.

/*N0RQ*/ define variable disp-cum-order-std     as character format "x(35)"
                                                no-undo.
/*N0RQ*/ define variable disp-cum-order-avg     as character format "x(35)"
                                                no-undo.
/*N0RQ*/ define variable disp-gl-cost           as character format "x(35)"
                                                no-undo.
/*N0RQ*/ define variable disp-by-site-itm-op-ln as character format "x(38)"
                                                no-undo.
/*N0RQ*/ define variable disp-by-ext-cost-desc  as character format "x(38)"
                                                no-undo.

         
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
            
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
lot                    colon 20
            lot1                   colon 45
            part                   colon 20
            part1                  colon 45
            site                   colon 20
            site1                  colon 45
            line                   colon 20
            line1                  colon 45
            reason                 colon 20
            reason1                colon 45
            wkctr                  colon 20
            wkctr1                 colon 45
            mch                    colon 20
            mch1                   colon 45
            dept                   colon 20
            dept1                  colon 45
            shift                  colon 20
            shift1                 colon 45
            emp                    colon 20
            emp1                   colon 45
            effdate                colon 20
            effdate1               colon 45
            cost_set_to_use        colon 35
/*N0RQ*     {&rewarp02_p_6}        at 40 */
/*N0RQ*     {&rewarp02_p_5}        at 40 */
/*N0RQ*     {&rewarp02_p_4}        at 40 */
/*N0RQ*/    disp-cum-order-std     at 40 no-label
/*N0RQ*/    disp-cum-order-avg     at 40 no-label
/*N0RQ*/    disp-gl-cost           at 40 no-label
            sortoption             colon 35
/*N0RQ*     {&rewarp02_p_7}        at 40 */
/*N0RQ*     {&rewarp02_p_2}        at 40 */
/*N0RQ*/    disp-by-site-itm-op-ln at 40 no-label
/*N0RQ*/    disp-by-ext-cost-desc  at 40 no-label
            report_cost_elements   colon 35
          SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



         /* SET EXTERNAL LABELS */
         setFrameLabels(frame a:handle).

         disp-cum-order-std     = "1 - " +
                                   getTermLabel("CUM_ORDER_STANDARD",35).
         disp-cum-order-avg     = "2 - " +
                                  getTermLabel("CUM_ORDER_AVERAGE",35).
         disp-gl-cost           = "3 - " +
                                  getTermLabel("GL_COST",35).
         disp-by-site-itm-op-ln = "1 - " +
                                  getTermLabel("BY_SITE",9) + ", " +
                                  getTermLabel("ITEM",6) + ", " +
                                  getTermLabel("OPERATION",12) + ", " +
                                  getTermLabel("LINE",5).
         disp-by-ext-cost-desc  =
               getTermLabel("BY_EXTENDED_COST_DESCENDING",38).
         cost_set_to_use = "1".

/*K13W*/ {wbrp01.i}
         
/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

            if lot1 = hi_char then lot1 = "".
            if part1 = hi_char then part1 = "".
            if site1 = hi_char then site1 = "".
            if line1 = hi_char then line1 = "".
            if reason1 = hi_char then reason1 = "".
            if wkctr1 = hi_char then wkctr1 = "".
            if mch1 = hi_char then mch1 = "".
            if dept1 = hi_char then dept1 = "".
            if shift1 = hi_char then shift1 = "".
            if emp1 = hi_char then emp1 = "".
            if effdate = low_date then effdate = ?.
            if effdate1 = hi_date then effdate1 = ?.

/*N0RQ*/    if c-application-mode <> 'web' then
/*N0RQ*/    display
               disp-cum-order-std
               disp-cum-order-avg
               disp-gl-cost
               disp-by-site-itm-op-ln
               disp-by-ext-cost-desc
            with frame a.

/*K13W*/    if c-application-mode <> 'web' then
            
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K13W*/    {wbrp06.i &command = update
                      &fields = "  lot lot1 part part1 site site1 line line1
                                 reason reason1 wkctr wkctr1 mch mch1 dept dept1
                                 shift shift1 emp emp1 effdate effdate1
                                 cost_set_to_use sortoption report_cost_elements"
                      &frm = "a"}

/*K13W*/    if (c-application-mode <> 'web') or
/*K13W*/       (c-application-mode = 'web' and
/*K13W*/       (c-web-request begins 'data'))
            then do:

               bcdparm = "".
               {mfquoter.i lot}
               {mfquoter.i lot1}
               {mfquoter.i part}
               {mfquoter.i part1}
               {mfquoter.i site}
               {mfquoter.i site1}
               {mfquoter.i line}
               {mfquoter.i line1}
               {mfquoter.i reason}
               {mfquoter.i reason1}
               {mfquoter.i wkctr}
               {mfquoter.i wkctr1}
               {mfquoter.i mch}
               {mfquoter.i mch1}
               {mfquoter.i dept}
               {mfquoter.i dept1}
               {mfquoter.i shift}
               {mfquoter.i shift1}
               {mfquoter.i emp}
               {mfquoter.i emp1}
               {mfquoter.i effdate}
               {mfquoter.i effdate1}
               {mfquoter.i cost_set_to_use}
               {mfquoter.i sortoption}
               {mfquoter.i report_cost_elements}

               if lot1 = "" then lot1 = hi_char.
               if part1 = "" then part1 = hi_char.
               if site1 = "" then site1 = hi_char.
               if line1 = "" then line1 = hi_char.
               if reason1 = "" then reason1 = hi_char.
               if wkctr1 = "" then wkctr1 = hi_char.
               if mch1 = "" then mch1 = hi_char.
               if dept1 = "" then dept1 = hi_char.
               if shift1 = "" then shift1 = hi_char.
               if emp1 = "" then emp1 = hi_char.
               if effdate = ? then effdate = low_date.
               if effdate1 = ? then effdate1 = hi_date.

/*K13W*/    end.

            
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:




            if sortoption = 1 then do:
               {gprun.i ""rewarp2a.p""}
            end.
            else do:
               {gprun.i ""rewarp2b.p""}
            end.

            
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


         end.

/*K13W*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" lot lot1 part part1 site site1 line line1 reason reason1 wkctr wkctr1 mch mch1 dept dept1 shift shift1 emp emp1 effdate effdate1 cost_set_to_use sortoption report_cost_elements "} /*Drive the Report*/
